{%extends "_base.html" %}

{% block contents %}

<meta name="project" content="{{ project }}">
<script src="/static/js/jstree.min.js"></script>
<link rel="stylesheet" href="/static/css/tree_themes/default/style.min.css" />

<style type="text/css">
   textarea {
 
  width: 100%;
  height: 500px;
  -moz-border-bottom-colors: none;
  -moz-border-left-colors: none;
  -moz-border-right-colors: none;
  -moz-border-top-colors: none;
  background: none repeat scroll 0 0 rgba(0, 0, 0, 0.07);
  border-color: -moz-use-text-color #FFFFFF #FFFFFF -moz-use-text-color;
  border-image: none;
  border-radius: 6px 6px 6px 6px;
  border-style: none solid solid none;
  border-width: medium 1px 1px medium;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) inset;
  color: #555555;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size: 1em;
  line-height: 1.4em;
  padding: 5px 8px;
  transition: background-color 0.2s ease 0s;
}
textarea:focus {
    background: none repeat scroll 0 0 #FFFFFF;
    outline-width: 0;
}
</style>
<br>

 <!--
      <aside class="main-sidebar">
       
        <div class="sidebar" id="scrollspy">

          

          <ul class="nav sidebar-menu">
            <li class="header">Web API Scan Results</li>
          </ul>
        </div>
      
      </aside>

    -->


<!-- Content -->
<h2 class="page-header"></h2>
<div class="request_view">
<div class="row">
    <div class="col-md-12">
          <div class="box box-solid">
            <div class="box-header with-border">
              <h3 class="box-title">FUZZER DASHBOARD <button type="button" class="btn btn-info btn-xs" onclick="show_projects()"> <span class="glyphicon glyphicon-list-alt"></span>  PROJECTS</button></h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="btn-group">
                <button type="button" class="btn btn-primary" onclick="scope_options()">Scan Scope</button>
                <button type="button" class="btn btn-primary" onclick="fuzzers()">Active Fuzzers</button>
                <button type="button" class="btn btn-primary" onclick="api_checks()">API Checks</button>
                <button type="button" class="btn btn-success" onclick="start_fuzz()">Start!</button>
              </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
  <div class="col-md-5">
          <div class="box box-solid">
            <div class="box-header with-border">
              <h3 class="box-title">CAPTURED TRAFFIC</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
               <div id="jstree_div">
                {% for domain, sub_flow in sorted_flows.items() %}
                  <ul>
                    <li data-jstree='{"icon":"glyphicon glyphicon-globe"}' id="{{domain}}">{{domain}}
                      {% for flw in sub_flow %}
                      <ul>
                        <li data-jstree='{"icon":"  glyphicon glyphicon-file"}' id="{{ flw['id']}}" data-url="{{flw['url']}}">{{flw['method']}} {{flw['relative']}}</li>
                      </ul>
                       {% end %} 
                    </li>
                  </ul>
                {% end %} 
               </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>

          <div class="col-md-7">
          <div class="box box-solid">
            <div class="box-header with-border">
              <h3 class="box-title">REQUEST &amp; RESPONSE</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
                    <div id="req_res">
                      <h6 class="box-title">REQUEST</h6>
                    <textarea class="form-control" rows="10" id="request">
              
                    </textarea>
                    
                      <h6 class="box-title">RESPONSE</h6>
                    <textarea class="form-control" rows="10" id="response">
                      
                    </textarea>
                    </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
</div>
</div>

<!-- Scan Options Modal -->
<div id="scan_scope" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
        <div class="col-md-12">
          <!-- Scan Scope Tabs -->

          <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Scan Includes</a></li>
              <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">Scan Excludes</a></li>
              <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">Exclude by default</a></li>
            </ul>
            <div class="tab-content">
              <div class="tab-pane active" id="tab_1">
                    <div class="box">
                      <div class="box-header">
                      </div>
                      <!-- /.box-header -->
                      <div class="box-body no-padding">
                        <div id="sp_txt"></div>
                        <table id="add_s" class="table table-striped">
                          <tbody><tr>
                            <th style="width: 10px">#</th>
                            <th>Match</th>
                            <th style="width: 40px">Remove</th>
                          </tr>
                        </tbody></table>
                      </div>
                      <!-- /.box-body -->
                    </div>
              </div>
              <!-- /.tab-pane -->
              <div class="tab-pane" id="tab_2">
                     <div class="box">
                        <div class="box-header">
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                          <table id="exc_s" class="table table-striped">
                            <tbody><tr>
                              <th style="width: 10px">#</th>
                              <th>Match</th>
                              <th style="width: 40px">Remove</th>
                            </tr>
                          </tbody></table>
                        </div>
                        <!-- /.box-body -->
                      </div>
              </div>
              <!-- /.tab-pane -->
              <div class="tab-pane" id="tab_3">
                    <div class="box">
                        <div class="box-header">
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                          <table id="exclude_tbl" class="table table-striped">
                            <tbody><tr>
                              <th>
                              <div class="checkbox">
                                <label><input id="exclude_url_match" type="checkbox" checked="checked"><strong>Excluded URL Matches</strong></label>
                              </div>
                              </th>
                            </tr>
                            <tr>
                              <td>
                              {% for exc in exclude_matches %}
                              {{ exc }} |
                              {% end %}
                              </td>
                            </tr>
                            <tr>
                              <th>
                              <div class="checkbox">
                                <label><input id="exclude_extensions" type="checkbox" checked="checked"><strong>Excluded Extensions</strong></label>
                              </div>
                              </th>
                            </tr>
                            <tr>
                              <td>
                              {% for ext in exclude_ext %}
                              {{ ext }} |
                              {% end %}
                              </td>
                            </tr>
                            <tr>
                              <th>
                              <div class="checkbox">
                                <label><input id="exclude_response_code" type="checkbox" checked="checked"><strong>Excluded Responses</strong></label>
                              </div>
                              </th>
                            </tr>
                            <tr>
                              <td>
                              {% for rs in exlude_rs_code %}
                              {{ rs }}XX
                              {% end %}
                              </td>
                            </tr>
                          </tbody>
                        </table>
                        </div>
                        <!-- /.box-body -->
                      </div>

                 
              </div>
              <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
          </div>
          <!-- nav-tabs-custom -->
        </div>
      </div>

  </div>
</div>

<!-- Fuzzers Modal -->
<div id="fuzz" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Active Fuzzers</h4>
      </div>
      <div class="modal-body">
          <div class="box-body no-padding">
            <table id="exc_s" class="table table-striped">
              <tbody>
                {% for fuzz in fuzzers %}
                <tr>
                <th><div class="checkbox">
                    <label><input id="fuzz_{{ f_slugify(fuzz) }}" type="checkbox" checked="checked">{{ fuzz }}</label>
                  </div>
                </th>
              </tr>
               {% end %}
            </tbody></table>
          </div>

        </div>
      
      </div>

  </div>
</div>

<!-- API Checks -->
<div id="api_checks" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">API Checks</h4>
      </div>
      <div class="modal-body">
          <div class="box-body no-padding">
           <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#api1" data-toggle="tab" aria-expanded="true">APIs</a></li>
              <li class=""><a href="#api2" data-toggle="tab" aria-expanded="false">IDOR Checks</a></li>
            </ul>
            <div class="tab-content">
              <div class="tab-pane active" id="api1">
                
                     <div class="box">
                      <div class="box-header">
                      </div>
                      <!-- /.box-header -->
                      <div class="box-body no-padding">
                        <table id="add_s" class="table table-striped">
                          <tbody>
                          <tr>
                            <th>API</th>
                            <th>URL</th>
                            <th>Remove</th>
                          </tr>
                          <tr>
                            <td>Login API</td>
                            <td><p id="api_login"></p></td>
                            <td><button type="button" class="btn btn-danger btn-xs" onclick="remove_api('api_login')">x</button> </td>
                          </tr>
                           <tr>
                            <td>Login PIN API</td>
                            <td><p id="api_pin"></p></td>
                            <td><button type="button" class="btn btn-danger btn-xs" onclick="remove_api('api_pin')">x</button> </td>
                          </tr>
                          <tr>
                            <td>Register API</td>
                            <td><p id="api_register"></p></td>
                            <td><button type="button" class="btn btn-danger btn-xs" onclick="remove_api('api_register')">x</button> </td>
                          </tr>

                        </tbody>
                        </table>
                      </div>
                      <!-- /.box-body -->
                     </div>
                
       
              </div>
              <!-- /.tab-pane -->
              <div class="tab-pane" id="api2">
                     <div class="box">
                        <div class="box-header">
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                          
                        </div>
                        <!-- /.box-body -->
                      </div>

              </div>
            </div>




          </div>

        </div>
      
      </div>

  </div>
</div>
</div>


<!-- Projects  -->
<div id="projects" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Projects</h4>
      </div>
      <div class="modal-body">
          <!-- /.box-header -->
          <div class="box-body no-padding">
             <select id="project_name" size="5">
              {% for pp in projects %}
                <option value="{{ pp }}">{{pp}}</option> 
              {% end %}
             </select>
             <div class="modal-footer">
               <div class="col-md-12 text-center"> 
               <button type="button" class="btn btn-info" onclick="load_project()">Load Project</button>
             </div>
            </div>
          </div>
          <!-- /.box-body -->
        </div>
      </div>

  </div>
</div>

<!-- Fuzzer Progress  -->
<div id="progress" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Fuzzer Progress</h4>
      </div>
      <div class="modal-body">
          <!-- /.box-header -->
           <div class="box-body no-padding">
             <textarea id="fuzz_progress"></textarea>
             <div class="modal-footer">
             </div>
            </div>
          </div>
          <!-- /.box-body -->
        </div>
      </div>

  </div>
</div>


<script type="text/javascript">

 
   
</script>


<!-- scripts -->
<script src="/static/js/fuzzer/dashboard.js" type="text/javascript"></script>
<script src="/static/js/fuzzer/scan_scope.js" type="text/javascript"></script>
<script src="/static/js/fuzzer/apis.js" type="text/javascript"></script>
<script src="/static/js/fuzzer/fuzzer.js" type="text/javascript"></script>
<script src="/static/js/fuzzer/utils.js" type="text/javascript"></script>
<script src="/static/js/jquery.growl.js" type="text/javascript"></script>
<link href="/static/css/jquery.growl.css" rel="stylesheet" type="text/css" />

{% end %}
